// BotQuestionServiceImpl.java
package com.agileboot.domain.bot.botQuestion.db;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class BotQuestionServiceImpl extends ServiceImpl<BotQuestionMapper, BotQuestionEntity> implements BotQuestionService {

    @Override
    public boolean isQuestionDuplicated(Integer id, String question) {
        QueryWrapper<BotQuestionEntity> wrapper = new QueryWrapper<>();
        wrapper.ne(id != null, "id", id).eq("question", question);
        return this.baseMapper.exists(wrapper);
    }
}
